package br.ufrj.neg.evento.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.velocity.tools.view.VelocityViewServlet;

import br.ufrj.neg.evento.model.EventoModel;


public class ExcluirContatoEventoAction extends VelocityViewServlet{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 6779498296415179383L;
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws IOException, ServletException {
		
		try {
			
			Integer idContato = Integer.parseInt(request.getParameter("idContato"));
			Integer idEvento = Integer.parseInt(request.getParameter("idEvento"));
			
			EventoModel.removeContatoEvento(idEvento, idContato);
			
				
		} catch (Exception e) {
			
			PrintWriter out = response.getWriter();
			out.println(e);
			
			
		}
	}
	public void doGet(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException {
		doPost(request, response);
	}
}
